<template>
	<view class="good-list">
		<uni-list>
			<uni-list-item v-for="(item,index) in list" :key="index">
				<template slot="body" >
					<view class="u-cell-group" @click="navigateTo(item)">
						<view class="title">
							{{item.title}}
						</view>
						<view>{{item.content}}</view>
						<view>{{item.createDate}}</view>
					</view>
				</template>
			</uni-list-item>
		</uni-list>
	</view>
</template>

<script>
	let that
	import {
		mapGetters,
		mapMutations
	} from 'vuex'
	export default {
		computed: {
			...mapGetters(['userInfo', 'api']),
		},
		props: {
			list: {
				type: [Array],
				default () {
					return []
				}
			}
		},
		data() {
			return {
			}
		},
		mounted() {
			that = this
		},
		methods: {
			navigateTo(item){
				if(item.title=='设备拆卸'){
					uni.navigateTo({
						url:'../dismounting/dismounting?id='+item.id
					})
				}
			}
		}

	}
</script>

<style lang="scss">
	.good-list {
		background-color: #fff;
		width: 100%;
		.u-cell-group {
			font-size: 28rpx;color: #888;line-height: 48rpx;
			box-sizing: border-box;width: 100%;
			display: flex;flex-direction: column;
			.title{
				font-weight: bold;color: #000;
			}
			.error-item{
				color:red;
			}
		}
		.slot-content{
			padding:20rpx 30rpx;
		}
	}
</style>
